﻿<UserControl
  x:Class="BookClub.Controls.BookEditor"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:ctl="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
  xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  mc:Ignorable="d"
  d:DesignHeight="500" d:DesignWidth="500"
  x:Name="control">
  
  <Grid DataContext="{Binding ElementName=control, Path=Book}">
    <Grid.ColumnDefinitions>
      <ColumnDefinition Width="Auto" />
      <ColumnDefinition Width="*" />
    </Grid.ColumnDefinitions>
    <Grid.RowDefinitions>
      <RowDefinition Height="Auto" />
      <RowDefinition Height="Auto" />
      <RowDefinition Height="Auto" />
      <RowDefinition Height="Auto" />
      <RowDefinition Height="Auto" />
      <RowDefinition Height="Auto" />
      <RowDefinition Height="Auto" />
      <RowDefinition Height="Auto" />
      <RowDefinition Height="Auto" />
    </Grid.RowDefinitions>

    <TextBlock Text="Title:" Style="{StaticResource label}" />
    <TextBox Grid.Row="1" Grid.ColumnSpan="2" Style="{StaticResource fullTextBox}"
      Text="{Binding Title, Mode=TwoWay}" />

    <TextBlock Grid.Row="2" Text="Author:" Style="{StaticResource label}" />
    <TextBox Grid.Row="3" Grid.ColumnSpan="2" Style="{StaticResource fullTextBox}"
      Text="{Binding Author, Mode=TwoWay}" />

    <TextBlock Grid.Row="4" Text="Publish Date:" Style="{StaticResource label}" />
    <ctl:DatePicker Grid.Row="4" Grid.Column="1" Style="{StaticResource datePicker}"
      SelectedDate="{Binding PublishDate, Mode=TwoWay}" />

    <TextBlock Grid.Row="5" Text="Category:" Style="{StaticResource label}" />
    <ComboBox Grid.Row="5" Grid.Column="1" Width="200" Margin="0,4,0,4" HorizontalAlignment="Left"
      ItemsSource="{Binding ElementName=control, Path=Categories}"
      DisplayMemberPath="CategoryName"
      SelectedItem="{Binding Category, Mode=TwoWay}" />

    <TextBlock Grid.Row="6" Text="Description:" Style="{StaticResource label}" />
    <TextBox Grid.Row="7" Grid.ColumnSpan="3" Style="{StaticResource textArea}"
      VerticalScrollBarVisibility="Auto"
      Text="{Binding Description, Mode=TwoWay}"/>

    <TextBlock Grid.Row="8" Text="Amazon ID:" Style="{StaticResource label}" />
    <TextBox Grid.Row="8" Grid.Column="1" Style="{StaticResource halfTextBox}"
      Text="{Binding ASIN, Mode=TwoWay}" />

  </Grid>
</UserControl>
